﻿using System;
using System.Collections.Generic;
using System.Text;
using UnionnetClient.Model;

namespace UnionnetClient
{
	class StateWithUiCreator : IStateFactory
	{
		public StateWithUiCreator(MainForm mainForm)
		{
			this.mainForm = mainForm;
		}

		#region IStateFactory 成员

		public UnconfigState CreateUncofingState(StateMachine stateMachine)
		{
			UnconfigStateWithUI state = new UnconfigStateWithUI(stateMachine);
			state.SetMainForm(mainForm);
			return state;
		}

		public UnloginState CreateUnloginState(StateMachine stateMachine)
		{
			UnloginStateWithUI state = new UnloginStateWithUI(stateMachine);
			state.SetMainForm(mainForm);
			return state;
		}

		public VpnState CreateVpnState(StateMachine stateMachine)
		{
			VpnStateWithUI state = new VpnStateWithUI(stateMachine);
			state.SetMainForm(mainForm);
			return state;
		}

		public NonVpnState CreateNonVpnState(StateMachine stateMachine)
		{
			NonVpnStateWithUI state = new NonVpnStateWithUI(stateMachine);
			state.SetMainForm(mainForm);
			return state;
		}

		public UnknownLoginedState CreateUnknownLoginedState(StateMachine stateMachine)
		{
			UnknownLoginedStateWithUI state = new UnknownLoginedStateWithUI(stateMachine);
			state.SetMainForm(mainForm);
			return state;
		}

		#endregion

		private MainForm mainForm;
	}
}
